<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
<style>
  #app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
  }
</style>
</head>

<body>
  <div id="app">
    <button @click="isLogin=true">登录</button>
    <button @click="isLogin=false">注册</button>

    <template v-if="isLogin">
      <h2>请登录</h2>
      <input type="text" placeholder="请输入用户名" key="login">
      <input type="text" placeholder="请输入密码" key="login">
    </template>

    <template v-else>
      <h2>请注册</h2>
      <input type="text" placeholder="请输入注册用户名" key="register">
      <input type="text" placeholder="请输入注册密码" key="register">
    </template>
  </div>
  <script>
    Vue.config.productionTip = false;
    //实例化Vue
    const vm = new Vue({
      el: "#app",
      data() {
        return {
          isLogin:true
        }
      }
    })
  </script>
</body>

</html>